/**
    \file errormsg.h
    \brief Functions used to deal with errors.
*/
/**    @defgroup error_message Error Message
    The Module of the error_message<br>
    Generally when the EM_error is called, it will print the error message
    in the console.
    @{
*/
#ifndef __ERRORMSG_H__
#define __ERRORMSG_H__

#include "util.h"

extern bool EM_anyErrors;

/**This function should be called everytime the grammer parser meets a new line
charactor, so that the error routine can point out the line number of a 
charactor when given a position.
*/
void EM_newline(void);

/// The position of the token.
extern int EM_tokPos;

/**This function is called when the syntax or grammer parser encounter a 
error*/
void EM_error(int, string,...);
void EM_impossible(string,...);
///Reset the input file variable and other variables
void EM_reset(string filename);

/**Get the line number by giving the position of a character
@param pos The position of the character
@return the line number in which the character is
*/
int EM_getLineNum(int pos);

#endif
///@}

